package org.tankwar.dao;

import org.tankwar.domain.User;
import org.tankwar.util.MapperFactory;
import java.util.Date;

public class MapperTest {

    public static void main(String[] args) {
        UserMapper userMapper = MapperFactory.getUserMapper();
        User user = userMapper.findById(1);
        System.out.println(user.getName());
        User user2 = userMapper.login("hzx", "123456");
        System.out.println(user2.getName());
        User user3 = new User("student", "1234", "张三", new Date());
        int res = userMapper.insertOneRecord(user3);
        System.out.println(res);
        MapperFactory.commitChanges();
        MapperFactory.closeSession();
    }
}
